﻿using SqlSugar;
using System;

namespace Infov1.Models
{
    [SugarTable("k_customer_info")]
    public class CustomerInfoModel
    {
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
        [SugarColumn(ColumnName = "customer_code")]
        public string CustomerCode { get; set; }

        [SugarColumn(ColumnName = "customer_code_td")]
        public string CustomerCodeTd { get; set; }

        [SugarColumn(ColumnName = "company_name")]
        public string CompanyName { get; set; }

        [SugarColumn(ColumnName = "contact_person")]
        public string ContactPerson { get; set; }

        [SugarColumn(ColumnName = "contact_phone")]
        public string ContactPhone { get; set; }

        [SugarColumn(ColumnName = "category_code")]
        public string CategoryCode { get; set; }

        [SugarColumn(ColumnName = "area_code")]
        public string AreaCode { get; set; }

        [SugarColumn(ColumnName = "address")]
        public string Address { get; set; }

        [SugarColumn(ColumnName = "notes")]
        public string Notes { get; set; }

        [SugarColumn(ColumnName = "creation_time")]
        public DateTime CreationTime { get; set; }

        [SugarColumn(ColumnName = "modification_time")]
        public DateTime ModificationTime { get; set; }

        // 导航属性，用于关联查询
        [Navigate(NavigateType.OneToOne, nameof(CategoryCode))]
        public CustomerCategoryModel Category { get; set; }

        [Navigate(NavigateType.OneToOne, nameof(AreaCode))]
        public CustomerAreaModel Area { get; set; } 
    }
}